<?php 
//update_option('siteurl','http://localhost:8080/yukicom');update_option('home','http://localhost:8080/yukicom');
$isDisable='';
function register_my_menu() {
  register_nav_menu('header-menu',__( 'Header Menu' ));
}
function t($data,$exit=1) {
	echo '<pre style="text-align:left;">';
	print_r($data);
	echo '</pre>';
	if($exit)exit;
}
function get_first_image_src($content,$type='thumb'){  
  $matches=array();
  
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
  $first_img = $matches [1] [0];
  return $first_img;
}	
function content_with_gallery($content){
	return do_shortcode($content);
}

function is_category_in($catname){
	$cats=array('static');
	return in_array($catname, $cats);
}

function isDisable(){
	global $isDisable;
	if($isDisable==''){
		$isDisable=false;
		if(is_single() && !is_admin())
		{
						
			$isDisable= true;
		}
		
	}
	return $isDisable;
	
}

function register_script(){

	if(isDisable()){
		//wp_enqueue_script('modernizr.custom',get_template_directory_uri().'/js/modernizr.custom.js');
		//wp_enqueue_script('classie',get_template_directory_uri().'/js/classie.js');
		
		wp_enqueue_style('style7',get_template_directory_uri() . '/css/style7.css',array());
	}
}
add_action( 'wp_enqueue_scripts', 'register_script' );

add_theme_support( 'post-thumbnails' );

//====================== custom post per page
$option_posts_per_page = get_option( 'posts_per_page' );
add_action( 'init', 'my_modify_posts_per_page', 0);
function my_modify_posts_per_page() {
	add_filter( 'option_posts_per_page', 'my_option_posts_per_page' );
}
function my_option_posts_per_page( $value ) {
	global $option_posts_per_page;
	$catname=get_query_var('category_name');
	if ( $catname=='video') {
		return 12;
	} 
	else if ( $catname=='news') {
		return 8;
	} else {
		return $option_posts_per_page;
	}
}
?>